<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>模型转换适配</title>
<script src="https://cdn.tailwindcss.com/3.4.16"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Pacifico&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/remixicon/4.6.0/remixicon.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/5.5.0/echarts.min.js"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: '#3b82f6',
secondary: '#64748b'
},
borderRadius: {
'none': '0px',
'sm': '4px',
DEFAULT: '8px',
'md': '12px',
'lg': '16px',
'xl': '20px',
'2xl': '24px',
'3xl': '32px',
'full': '9999px',
'button': '8px'
}
}
}
}
</script>
<style>
:where([class^="ri-"])::before { content: "\f3c2"; }
.model-card:hover {
transform: translateY(-4px);
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.model-card {
transition: all 0.3s ease;
}
.custom-switch {
position: relative;
display: inline-block;
width: 40px;
height: 20px;
}
.custom-switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: .4s;
border-radius: 34px;
}
.slider:before {
position: absolute;
content: "";
height: 16px;
width: 16px;
left: 2px;
bottom: 2px;
background-color: white;
transition: .4s;
border-radius: 50%;
}
input:checked + .slider {
background-color: #3b82f6;
}
input:checked + .slider:before {
transform: translateX(20px);
}
.custom-checkbox {
position: relative;
display: inline-block;
width: 18px;
height: 18px;
margin-right: 8px;
}
.custom-checkbox input {
opacity: 0;
width: 0;
height: 0;
}
.checkmark {
position: absolute;
top: 0;
left: 0;
height: 18px;
width: 18px;
background-color: #fff;
border: 2px solid #d1d5db;
border-radius: 4px;
}
.custom-checkbox input:checked ~ .checkmark {
background-color: #3b82f6;
border-color: #3b82f6;
}
.checkmark:after {
content: "";
position: absolute;
display: none;
}
.custom-checkbox input:checked ~ .checkmark:after {
display: block;
}
.custom-checkbox .checkmark:after {
left: 5px;
top: 2px;
width: 5px;
height: 10px;
border: solid white;
border-width: 0 2px 2px 0;
transform: rotate(45deg);
}
.custom-radio {
position: relative;
display: inline-block;
width: 18px;
height: 18px;
margin-right: 8px;
}
.custom-radio input {
opacity: 0;
width: 0;
height: 0;
}
.radiomark {
position: absolute;
top: 0;
left: 0;
height: 18px;
width: 18px;
background-color: #fff;
border: 2px solid #d1d5db;
border-radius: 50%;
}
.custom-radio input:checked ~ .radiomark {
border-color: #3b82f6;
}
.radiomark:after {
content: "";
position: absolute;
display: none;
}
.custom-radio input:checked ~ .radiomark:after {
display: block;
}
.custom-radio .radiomark:after {
top: 3px;
left: 3px;
width: 8px;
height: 8px;
border-radius: 50%;
background: #3b82f6;
}
.custom-range {
-webkit-appearance: none;
width: 100%;
height: 6px;
background: #e5e7eb;
border-radius: 5px;
outline: none;
}
.custom-range::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 16px;
height: 16px;
background: #3b82f6;
border-radius: 50%;
cursor: pointer;
}
.custom-range::-moz-range-thumb {
width: 16px;
height: 16px;
background: #3b82f6;
border-radius: 50%;
cursor: pointer;
}
.tab-active {
color: #3b82f6;
border-bottom: 2px solid #3b82f6;
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
}
.metric-card:hover {
transform: translateY(-4px);
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
transition: all 0.3s ease;
}
.format-card:hover {
transform: translateY(-4px);
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
transition: all 0.3s ease;
}
</style>
</head>
<body class="bg-gray-50 min-h-screen">
<!-- 顶部导航 -->
<div class="flex h-screen bg-gray-50">
<!-- 左侧菜单栏 -->
<aside class="w-64 bg-white shadow-sm">
<div class="p-4 border-b border-gray-100">
<h1 class="text-2xl font-['Pacifico'] text-primary">logo</h1>
</div>
<nav class="p-4">
<div class="space-y-4">
<!-- 模型管理 -->
<div>
<div class="flex items-center justify-between px-3 py-2 text-primary font-medium rounded-md bg-blue-50">
<div class="flex items-center">
<i class="ri-database-2-line mr-2"></i>
<span>模型管理</span>
</div>
<i class="ri-arrow-down-s-line"></i>
</div>
<div class="mt-2 ml-4 space-y-1">
<a href="https://readdy.ai/home/42b69b4b-e314-4f8d-9e2f-98a4952face1/a4a56980-4c92-4089-9e55-c16717a4c6a2" data-readdy="true" class="flex items-center px-3 py-2 text-sm text-gray-600 hover:text-gray-900 rounded-md hover:bg-gray-50">
<i class="ri-pulse-line mr-2"></i>
模型生命周期
</a>
<a href="https://readdy.ai/home/42b69b4b-e314-4f8d-9e2f-98a4952face1/98e98a6a-5b99-4a24-9326-e2a27feda74d" data-readdy="true" class="flex items-center px-3 py-2 text-sm text-gray-600 hover:text-gray-900 rounded-md hover:bg-gray-50">
<i class="ri-bar-chart-line mr-2"></i>
模型性能评估
</a>
<a href="#" class="flex items-center px-3 py-2 text-sm text-primary bg-blue-50 rounded-md">
<i class="ri-loop-left-line mr-2"></i>
模型转换适配
</a>
</div>
</div>
<!-- 推理服务 -->
<div>
<a href="https://readdy.ai/home/42b69b4b-e314-4f8d-9e2f-98a4952face1/inference-service" data-readdy="true" class="flex items-center justify-between px-3 py-2 text-gray-700 font-medium rounded-md hover:bg-gray-50">
<div class="flex items-center">
<i class="ri-cpu-line mr-2"></i>
<span>推理服务</span>
</div>
<i class="ri-arrow-right-s-line transition-transform rotate-90"></i>
</a>
</div>
<!-- API 接口 -->
<div>
<div class="flex items-center justify-between px-3 py-2 text-gray-700 font-medium rounded-md hover:bg-gray-50">
<div class="flex items-center">
<i class="ri-code-line mr-2"></i>
<span>API 接口</span>
</div>
<i class="ri-arrow-down-s-line"></i>
</div>
</div>
<!-- 数据处理 -->
<div>
<div class="flex items-center justify-between px-3 py-2 text-gray-700 font-medium rounded-md hover:bg-gray-50">
<div class="flex items-center">
<i class="ri-file-list-3-line mr-2"></i>
<span>数据处理</span>
</div>
<i class="ri-arrow-down-s-line"></i>
</div>
</div>
</div>
</nav>
</aside>
<!-- 主要内容区域 -->
<div class="flex-1 flex flex-col overflow-hidden">
<!-- 顶部导航栏 -->
<header class="bg-white shadow-sm">
<div class="flex items-center justify-between px-6 py-3">
<div class="relative">
<input type="text" placeholder="搜索..." class="pl-10 pr-4 py-2 border border-gray-300 rounded-button text-sm focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
<div class="absolute left-3 top-2.5 w-4 h-4 flex items-center justify-center text-gray-400">
<i class="ri-search-line"></i>
</div>
</div>
<div class="flex items-center space-x-4">
<div class="w-8 h-8 flex items-center justify-center rounded-full bg-blue-50 text-primary">
<i class="ri-notification-3-line"></i>
</div>
<div class="w-8 h-8 flex items-center justify-center rounded-full bg-blue-50 text-primary">
<i class="ri-settings-3-line"></i>
</div>
<div class="flex items-center">
<img src="https://readdy.ai/api/search-image?query=professional%252520headshot%252520of%252520a%252520young%252520asian%252520man%252520with%252520short%252520black%252520hair%25252C%252520business%252520casual%252520attire%25252C%252520neutral%252520background%25252C%252520high%252520quality%252520portrait&width=80&height=80&seq=1&orientation=squarish" alt="用户头像" class="w-8 h-8 rounded-full object-cover">
<span class="ml-2 text-sm font-medium text-gray-700">陈思远</span>
</div>
</div>
</div>
</header>
<!-- 主要内容区域 -->
<main class="flex-1 overflow-y-auto px-6 py-8">
<!-- 面包屑导航 -->
<div class="flex items-center text-sm text-gray-500 mb-6">
<a href="#" class="hover:text-primary">首页</a>
<span class="mx-2">/</span>
<a href="#" class="hover:text-primary">模型管理</a>
<span class="mx-2">/</span>
<span class="text-gray-700">模型转换适配</span>
</div>
<!-- 页面标题和操作按钮 -->
<div class="flex justify-between items-center mb-8">
<h1 class="text-2xl font-bold text-gray-900">模型转换适配</h1>
<div class="flex space-x-3">
<button id="newConversionBtn" class="flex items-center px-4 py-2 bg-primary text-white rounded-button text-sm font-medium hover:bg-blue-600 whitespace-nowrap !rounded-button">
<div class="w-4 h-4 flex items-center justify-center mr-2">
<i class="ri-add-line"></i>
</div>
新建转换任务
</button>
</div>
</div>
<!-- 转换任务概览卡片 -->
<div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-8">
<div class="bg-white p-6 rounded-lg shadow-sm metric-card">
<div class="flex justify-between items-start">
<div>
<p class="text-sm font-medium text-gray-500">总转换任务数</p>
<p class="text-2xl font-bold text-gray-900 mt-1">28</p>
</div>
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-blue-50 text-primary">
<i class="ri-file-transfer-line ri-lg"></i>
</div>
</div>
<div class="mt-4">
<div class="w-full bg-gray-200 rounded-full h-1.5">
<div class="bg-primary h-1.5 rounded-full" style="width: 70%"></div>
</div>
<p class="text-xs text-gray-500 mt-2">较上月 <span class="text-green-500">+5</span></p>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow-sm metric-card">
<div class="flex justify-between items-start">
<div>
<p class="text-sm font-medium text-gray-500">进行中任务</p>
<p class="text-2xl font-bold text-gray-900 mt-1">3</p>
</div>
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-yellow-50 text-yellow-500">
<i class="ri-loader-4-line ri-lg"></i>
</div>
</div>
<div class="mt-4">
<div class="w-full bg-gray-200 rounded-full h-1.5">
<div class="bg-yellow-500 h-1.5 rounded-full" style="width: 15%"></div>
</div>
<p class="text-xs text-gray-500 mt-2">较上月 <span class="text-yellow-500">+1</span></p>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow-sm metric-card">
<div class="flex justify-between items-start">
<div>
<p class="text-sm font-medium text-gray-500">转换成功率</p>
<p class="text-2xl font-bold text-gray-900 mt-1">92.5%</p>
</div>
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-green-50 text-green-500">
<i class="ri-check-double-line ri-lg"></i>
</div>
</div>
<div class="mt-4">
<div class="w-full bg-gray-200 rounded-full h-1.5">
<div class="bg-green-500 h-1.5 rounded-full" style="width: 92.5%"></div>
</div>
<p class="text-xs text-gray-500 mt-2">较上月 <span class="text-green-500">+2.3%</span></p>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow-sm metric-card">
<div class="flex justify-between items-start">
<div>
<p class="text-sm font-medium text-gray-500">平均转换时间</p>
<p class="text-2xl font-bold text-gray-900 mt-1">12分钟</p>
</div>
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-purple-50 text-purple-500">
<i class="ri-time-line ri-lg"></i>
</div>
</div>
<div class="mt-4">
<div class="w-full bg-gray-200 rounded-full h-1.5">
<div class="bg-purple-500 h-1.5 rounded-full" style="width: 60%"></div>
</div>
<p class="text-xs text-gray-500 mt-2">较上月 <span class="text-green-500">-3分钟</span></p>
</div>
</div>
</div>
<!-- 转换任务列表 -->
<div class="bg-white rounded-lg shadow-sm mb-8">
<div class="flex justify-between items-center p-6 border-b border-gray-100">
<h2 class="text-lg font-medium text-gray-900">转换任务列表</h2>
<div class="flex items-center space-x-3">
<div class="relative">
<input type="text" id="taskSearchInput" placeholder="搜索任务..." class="pl-10 pr-4 py-2 border border-gray-300 rounded-button text-sm focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
<div class="absolute left-3 top-2.5 w-4 h-4 flex items-center justify-center text-gray-400">
<i class="ri-search-line"></i>
</div>
</div>
<select class="pl-3 pr-8 py-2 border border-gray-300 rounded-button text-sm focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent appearance-none bg-white">
<option>所有状态</option>
<option>进行中</option>
<option>已完成</option>
<option>失败</option>
</select>
</div>
</div>
<div class="p-6">
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">任务名称</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">源模型</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">目标格式</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">创建时间</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">转换时长</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">状态</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">操作</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="w-8 h-8 flex items-center justify-center rounded bg-blue-50 text-primary mr-3">
<i class="ri-file-transfer-line"></i>
</div>
<div>
<div class="text-sm font-medium text-gray-900">PyTorch 转 ONNX</div>
<div class="text-xs text-gray-500">CONV-20250626-001</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">智能推荐模型 v2.3.5</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">ONNX</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2025-06-26 09:30</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">8分钟</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs font-medium text-green-700 bg-green-100 rounded-full">已完成</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<button class="text-primary hover:text-blue-600 mr-3">查看</button>
<button class="text-primary hover:text-blue-600 download-btn">下载</button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="w-8 h-8 flex items-center justify-center rounded bg-blue-50 text-primary mr-3">
<i class="ri-file-transfer-line"></i>
</div>
<div>
<div class="text-sm font-medium text-gray-900">TensorFlow 转 TensorRT</div>
<div class="text-xs text-gray-500">CONV-20250625-002</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">图像识别模型 v1.8.2</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">TensorRT</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2025-06-25 14:15</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">15分钟</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs font-medium text-green-700 bg-green-100 rounded-full">已完成</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<button class="text-primary hover:text-blue-600 mr-3">查看</button>
<button class="text-primary hover:text-blue-600 download-btn">下载</button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="w-8 h-8 flex items-center justify-center rounded bg-blue-50 text-primary mr-3">
<i class="ri-file-transfer-line"></i>
</div>
<div>
<div class="text-sm font-medium text-gray-900">ONNX 转 OpenVINO</div>
<div class="text-xs text-gray-500">CONV-20250625-003</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">NLP 对话模型 v3.1.0</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">OpenVINO</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2025-06-25 10:45</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">-</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs font-medium text-yellow-700 bg-yellow-100 rounded-full">进行中</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<button class="text-primary hover:text-blue-600 mr-3">查看</button>
<button class="text-gray-400 cursor-not-allowed">下载</button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="w-8 h-8 flex items-center justify-center rounded bg-blue-50 text-primary mr-3">
<i class="ri-file-transfer-line"></i>
</div>
<div>
<div class="text-sm font-medium text-gray-900">Keras 转 TensorFlow Lite</div>
<div class="text-xs text-gray-500">CONV-20250624-004</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">预测分析模型 v1.2.7</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">TensorFlow Lite</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2025-06-24 16:20</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">10分钟</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs font-medium text-green-700 bg-green-100 rounded-full">已完成</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<button class="text-primary hover:text-blue-600 mr-3">查看</button>
<button class="text-primary hover:text-blue-600 download-btn">下载</button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="w-8 h-8 flex items-center justify-center rounded bg-blue-50 text-primary mr-3">
<i class="ri-file-transfer-line"></i>
</div>
<div>
<div class="text-sm font-medium text-gray-900">PyTorch 转 TorchScript</div>
<div class="text-xs text-gray-500">CONV-20250624-005</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">语音识别模型 v2.0.1</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">TorchScript</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2025-06-24 11:30</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">-</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs font-medium text-yellow-700 bg-yellow-100 rounded-full">进行中</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<button class="text-primary hover:text-blue-600 mr-3">查看</button>
<button class="text-gray-400 cursor-not-allowed">下载</button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="w-8 h-8 flex items-center justify-center rounded bg-blue-50 text-primary mr-3">
<i class="ri-file-transfer-line"></i>
</div>
<div>
<div class="text-sm font-medium text-gray-900">TensorFlow 转 TensorFlow.js</div>
<div class="text-xs text-gray-500">CONV-20250623-006</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">情感分析模型 v1.5.3</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">TensorFlow.js</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2025-06-23 09:45</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">-</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs font-medium text-red-700 bg-red-100 rounded-full">失败</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<button class="text-primary hover:text-blue-600 mr-3">查看</button>
<button class="text-primary hover:text-blue-600">重试</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="flex justify-between items-center mt-6">
<div class="text-sm text-gray-500">
显示 1-6 条，共 28 条
</div>
<div class="flex items-center space-x-2">
<button class="w-8 h-8 flex items-center justify-center rounded border border-gray-300 text-gray-500 bg-white disabled:opacity-50" disabled>
<i class="ri-arrow-left-s-line"></i>
</button>
<button class="w-8 h-8 flex items-center justify-center rounded border border-primary text-white bg-primary">
1
</button>
<button class="w-8 h-8 flex items-center justify-center rounded border border-gray-300 text-gray-700 bg-white hover:border-primary hover:text-primary">
2
</button>
<button class="w-8 h-8 flex items-center justify-center rounded border border-gray-300 text-gray-700 bg-white hover:border-primary hover:text-primary">
3
</button>
<button class="w-8 h-8 flex items-center justify-center rounded border border-gray-300 text-gray-700 bg-white hover:border-primary hover:text-primary">
<i class="ri-more-line"></i>
</button>
<button class="w-8 h-8 flex items-center justify-center rounded border border-gray-300 text-gray-700 bg-white hover:border-primary hover:text-primary">
<i class="ri-arrow-right-s-line"></i>
</button>
</div>
</div>
</div>
</div>
<!-- 支持的格式和平台 -->
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
<div class="bg-white p-6 rounded-lg shadow-sm">
<div class="flex justify-between items-center mb-6">
<h2 class="text-lg font-medium text-gray-900">支持的源格式</h2>
</div>
<div class="grid grid-cols-2 sm:grid-cols-3 gap-4">
<div class="bg-gray-50 p-4 rounded-lg format-card">
<div class="flex items-center mb-3">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-blue-50 text-primary mr-3">
<i class="ri-file-code-line ri-lg"></i>
</div>
<div>
<h3 class="text-sm font-medium text-gray-800">PyTorch</h3>
<p class="text-xs text-gray-500">*.pt, *.pth</p>
</div>
</div>
<div class="text-xs text-gray-500">支持版本: 1.7+</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg format-card">
<div class="flex items-center mb-3">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-blue-50 text-primary mr-3">
<i class="ri-file-code-line ri-lg"></i>
</div>
<div>
<h3 class="text-sm font-medium text-gray-800">TensorFlow</h3>
<p class="text-xs text-gray-500">*.pb, SavedModel</p>
</div>
</div>
<div class="text-xs text-gray-500">支持版本: 2.0+</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg format-card">
<div class="flex items-center mb-3">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-blue-50 text-primary mr-3">
<i class="ri-file-code-line ri-lg"></i>
</div>
<div>
<h3 class="text-sm font-medium text-gray-800">ONNX</h3>
<p class="text-xs text-gray-500">*.onnx</p>
</div>
</div>
<div class="text-xs text-gray-500">支持版本: 1.6+</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg format-card">
<div class="flex items-center mb-3">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-blue-50 text-primary mr-3">
<i class="ri-file-code-line ri-lg"></i>
</div>
<div>
<h3 class="text-sm font-medium text-gray-800">Keras</h3>
<p class="text-xs text-gray-500">*.h5, *.keras</p>
</div>
</div>
<div class="text-xs text-gray-500">支持版本: 2.2+</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg format-card">
<div class="flex items-center mb-3">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-blue-50 text-primary mr-3">
<i class="ri-file-code-line ri-lg"></i>
</div>
<div>
<h3 class="text-sm font-medium text-gray-800">Caffe</h3>
<p class="text-xs text-gray-500">*.caffemodel</p>
</div>
</div>
<div class="text-xs text-gray-500">支持版本: 1.0+</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg format-card">
<div class="flex items-center mb-3">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-blue-50 text-primary mr-3">
<i class="ri-file-code-line ri-lg"></i>
</div>
<div>
<h3 class="text-sm font-medium text-gray-800">MXNet</h3>
<p class="text-xs text-gray-500">*.params</p>
</div>
</div>
<div class="text-xs text-gray-500">支持版本: 1.5+</div>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow-sm">
<div class="flex justify-between items-center mb-6">
<h2 class="text-lg font-medium text-gray-900">支持的目标格式</h2>
</div>
<div class="grid grid-cols-2 sm:grid-cols-3 gap-4">
<div class="bg-gray-50 p-4 rounded-lg format-card">
<div class="flex items-center mb-3">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-green-50 text-green-500 mr-3">
<i class="ri-file-code-line ri-lg"></i>
</div>
<div>
<h3 class="text-sm font-medium text-gray-800">ONNX</h3>
<p class="text-xs text-gray-500">跨平台标准</p>
</div>
</div>
<div class="text-xs text-gray-500">适用场景: 通用</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg format-card">
<div class="flex items-center mb-3">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-green-50 text-green-500 mr-3">
<i class="ri-file-code-line ri-lg"></i>
</div>
<div>
<h3 class="text-sm font-medium text-gray-800">TensorRT</h3>
<p class="text-xs text-gray-500">NVIDIA 优化</p>
</div>
</div>
<div class="text-xs text-gray-500">适用场景: GPU 推理</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg format-card">
<div class="flex items-center mb-3">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-green-50 text-green-500 mr-3">
<i class="ri-file-code-line ri-lg"></i>
</div>
<div>
<h3 class="text-sm font-medium text-gray-800">TF Lite</h3>
<p class="text-xs text-gray-500">移动设备优化</p>
</div>
</div>
<div class="text-xs text-gray-500">适用场景: 移动端</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg format-card">
<div class="flex items-center mb-3">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-green-50 text-green-500 mr-3">
<i class="ri-file-code-line ri-lg"></i>
</div>
<div>
<h3 class="text-sm font-medium text-gray-800">OpenVINO</h3>
<p class="text-xs text-gray-500">Intel 优化</p>
</div>
</div>
<div class="text-xs text-gray-500">适用场景: CPU 推理</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg format-card">
<div class="flex items-center mb-3">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-green-50 text-green-500 mr-3">
<i class="ri-file-code-line ri-lg"></i>
</div>
<div>
<h3 class="text-sm font-medium text-gray-800">TorchScript</h3>
<p class="text-xs text-gray-500">PyTorch 序列化</p>
</div>
</div>
<div class="text-xs text-gray-500">适用场景: 生产环境</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg format-card">
<div class="flex items-center mb-3">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-green-50 text-green-500 mr-3">
<i class="ri-file-code-line ri-lg"></i>
</div>
<div>
<h3 class="text-sm font-medium text-gray-800">TF.js</h3>
<p class="text-xs text-gray-500">浏览器运行</p>
</div>
</div>
<div class="text-xs text-gray-500">适用场景: Web 应用</div>
</div>
</div>
</div>
</div>
<!-- 性能对比数据 -->
<div class="bg-white rounded-lg shadow-sm mb-8">
<div class="flex justify-between items-center p-6 border-b border-gray-100">
<h2 class="text-lg font-medium text-gray-900">转换后性能对比</h2>
<div class="flex items-center space-x-4">
<select class="pl-3 pr-8 py-2 border border-gray-300 rounded-button text-sm focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent appearance-none bg-white">
<option>智能推荐模型</option>
<option>图像识别模型</option>
<option>NLP 对话模型</option>
<option>预测分析模型</option>
<option>语音识别模型</option>
</select>
</div>
</div>
<div class="p-6">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
<div>
<h3 class="text-base font-medium text-gray-800 mb-4">推理性能对比 (ms)</h3>
<div id="inferencePerformanceChart" class="h-80"></div>
</div>
<div>
<h3 class="text-base font-medium text-gray-800 mb-4">内存占用对比 (MB)</h3>
<div id="memoryUsageChart" class="h-80"></div>
</div>
</div>
<div class="mb-6">
<h3 class="text-base font-medium text-gray-800 mb-4">精度对比</h3>
<div id="accuracyComparisonChart" class="h-64"></div>
</div>
<div>
<h3 class="text-base font-medium text-gray-800 mb-4">详细性能指标</h3>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">格式</th>
<th scope="col" class="px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">推理时间 (ms)</th>
<th scope="col" class="px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">内存占用 (MB)</th>
<th scope="col" class="px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">模型大小 (MB)</th>
<th scope="col" class="px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">准确率 (%)</th>
<th scope="col" class="px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">加载时间 (ms)</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="w-8 h-8 flex items-center justify-center rounded bg-blue-50 text-primary mr-3">
<i class="ri-file-code-line"></i>
</div>
<div class="text-sm font-medium text-gray-900">PyTorch (原始)</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">25.3</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">850</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">245</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">92.7</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">320</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="w-8 h-8 flex items-center justify-center rounded bg-green-50 text-green-500 mr-3">
<i class="ri-file-code-line"></i>
</div>
<div class="text-sm font-medium text-gray-900">ONNX</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">18.5</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">720</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">210</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">92.6</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">280</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="w-8 h-8 flex items-center justify-center rounded bg-green-50 text-green-500 mr-3">
<i class="ri-file-code-line"></i>
</div>
<div class="text-sm font-medium text-gray-900">TensorRT</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">8.2</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">780</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">235</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">92.5</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">350</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="w-8 h-8 flex items-center justify-center rounded bg-green-50 text-green-500 mr-3">
<i class="ri-file-code-line"></i>
</div>
<div class="text-sm font-medium text-gray-900">TorchScript</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">22.1</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">820</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">240</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">92.7</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">290</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="w-8 h-8 flex items-center justify-center rounded bg-green-50 text-green-500 mr-3">
<i class="ri-file-code-line"></i>
</div>
<div class="text-sm font-medium text-gray-900">OpenVINO</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">12.4</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">680</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">205</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">92.4</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">260</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- 平台适配指南 -->
<div class="bg-white rounded-lg shadow-sm mb-8">
<div class="flex justify-between items-center p-6 border-b border-gray-100">
<h2 class="text-lg font-medium text-gray-900">平台适配指南</h2>
</div>
<div class="p-6">
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<div class="bg-gray-50 p-5 rounded-lg">
<div class="flex items-center mb-4">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-blue-50 text-primary mr-3">
<i class="ri-smartphone-line ri-lg"></i>
</div>
<h3 class="text-base font-medium text-gray-800">移动设备</h3>
</div>
<ul class="space-y-3">
<li class="flex items-start">
<div class="w-5 h-5 flex items-center justify-center text-green-500 mt-0.5 mr-2">
<i class="ri-checkbox-circle-line"></i>
</div>
<span class="text-sm text-gray-600">TensorFlow Lite (Android/iOS)</span>
</li>
<li class="flex items-start">
<div class="w-5 h-5 flex items-center justify-center text-green-500 mt-0.5 mr-2">
<i class="ri-checkbox-circle-line"></i>
</div>
<span class="text-sm text-gray-600">Core ML (iOS)</span>
</li>
<li class="flex items-start">
<div class="w-5 h-5 flex items-center justify-center text-green-500 mt-0.5 mr-2">
<i class="ri-checkbox-circle-line"></i>
</div>
<span class="text-sm text-gray-600">PyTorch Mobile</span>
</li>
</ul>
<a href="https://readdy.ai/home/42b69b4b-e314-4f8d-9e2f-98a4952face1/5cef4c2f-7b1c-4000-9481-4bf15bfbc86a" data-readdy="true" class="block">
<button class="mt-4 px-4 py-2 bg-white border border-gray-300 rounded-button text-sm font-medium text-gray-700 hover:bg-gray-50 w-full whitespace-nowrap !rounded-button">查看适配指南</button>
</a>
</div>
<div class="bg-gray-50 p-5 rounded-lg">
<div class="flex items-center mb-4">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-purple-50 text-purple-500 mr-3">
<i class="ri-global-line ri-lg"></i>
</div>
<h3 class="text-base font-medium text-gray-800">Web 浏览器</h3>
</div>
<ul class="space-y-3">
<li class="flex items-start">
<div class="w-5 h-5 flex items-center justify-center text-green-500 mt-0.5 mr-2">
<i class="ri-checkbox-circle-line"></i>
</div>
<span class="text-sm text-gray-600">TensorFlow.js</span>
</li>
<li class="flex items-start">
<div class="w-5 h-5 flex items-center justify-center text-green-500 mt-0.5 mr-2">
<i class="ri-checkbox-circle-line"></i>
</div>
<span class="text-sm text-gray-600">ONNX.js</span>
</li>
<li class="flex items-start">
<div class="w-5 h-5 flex items-center justify-center text-green-500 mt-0.5 mr-2">
<i class="ri-checkbox-circle-line"></i>
</div>
<span class="text-sm text-gray-600">WebNN API</span>
</li>
</ul>
<a href="https://readdy.ai/home/42b69b4b-e314-4f8d-9e2f-98a4952face1/5cef4c2f-7b1c-4000-9481-4bf15bfbc86a" data-readdy="true" class="block">
<button class="mt-4 px-4 py-2 bg-white border border-gray-300 rounded-button text-sm font-medium text-gray-700 hover:bg-gray-50 w-full whitespace-nowrap !rounded-button">查看适配指南</button>
</a>
</div>
<div class="bg-gray-50 p-5 rounded-lg">
<div class="flex items-center mb-4">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-green-50 text-green-500 mr-3">
<i class="ri-server-line ri-lg"></i>
</div>
<h3 class="text-base font-medium text-gray-800">边缘设备</h3>
</div>
<ul class="space-y-3">
<li class="flex items-start">
<div class="w-5 h-5 flex items-center justify-center text-green-500 mt-0.5 mr-2">
<i class="ri-checkbox-circle-line"></i>
</div>
<span class="text-sm text-gray-600">TensorRT (NVIDIA)</span>
</li>
<li class="flex items-start">
<div class="w-5 h-5 flex items-center justify-center text-green-500 mt-0.5 mr-2">
<i class="ri-checkbox-circle-line"></i>
</div>
<span class="text-sm text-gray-600">OpenVINO (Intel)</span>
</li>
<li class="flex items-start">
<div class="w-5 h-5 flex items-center justify-center text-green-500 mt-0.5 mr-2">
<i class="ri-checkbox-circle-line"></i>
</div>
<span class="text-sm text-gray-600">TVM (多平台)</span>
</li>
</ul>
<a href="https://readdy.ai/home/42b69b4b-e314-4f8d-9e2f-98a4952face1/5cef4c2f-7b1c-4000-9481-4bf15bfbc86a" data-readdy="true" class="block">
<button class="mt-4 px-4 py-2 bg-white border border-gray-300 rounded-button text-sm font-medium text-gray-700 hover:bg-gray-50 w-full whitespace-nowrap !rounded-button">查看适配指南</button>
</a>
</div>
</div>
</div>
</div>
</main>
<!-- 新建转换任务模态框 -->
<div id="newConversionModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-lg w-full max-w-2xl max-h-[90vh] overflow-y-auto">
<div class="flex justify-between items-center p-6 border-b border-gray-100">
<h3 class="text-lg font-medium text-gray-900">新建模型转换任务</h3>
<button id="closeNewConversionModal" class="text-gray-400 hover:text-gray-500">
<i class="ri-close-line ri-lg"></i>
</button>
</div>
<div class="p-6">
<div class="mb-6">
<div class="flex justify-between items-center mb-2">
<label class="block text-sm font-medium text-gray-700">基本信息</label>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">任务名称</label>
<input type="text" class="w-full px-3 py-2 border border-gray-300 rounded-button text-sm focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="输入转换任务名称">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">选择源模型</label>
<select class="w-full px-3 py-2 border border-gray-300 rounded-button text-sm focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent pr-8 appearance-none bg-white">
<option>智能推荐模型 v2.3.5 (PyTorch)</option>
<option>图像识别模型 v1.8.2 (TensorFlow)</option>
<option>NLP 对话模型 v3.1.0 (ONNX)</option>
<option>预测分析模型 v1.2.7 (Keras)</option>
<option>语音识别模型 v2.0.1 (PyTorch)</option>
</select>
</div>
</div>
</div>
<div class="mb-6">
<label class="block text-sm font-medium text-gray-700 mb-1">转换描述</label>
<textarea class="w-full px-3 py-2 border border-gray-300 rounded-button text-sm focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" rows="2" placeholder="输入转换任务的详细描述"></textarea>
</div>
<div class="mb-6">
<div class="flex justify-between items-center mb-2">
<label class="block text-sm font-medium text-gray-700">转换配置</label>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">目标格式</label>
<select class="w-full px-3 py-2 border border-gray-300 rounded-button text-sm focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent pr-8 appearance-none bg-white">
<option>ONNX</option>
<option>TensorRT</option>
<option>TensorFlow Lite</option>
<option>OpenVINO</option>
<option>TorchScript</option>
<option>TensorFlow.js</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">目标平台</label>
<div class="relative">
<select class="w-full px-3 py-2 border border-gray-300 rounded-button text-sm focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent pr-8 appearance-none bg-white">
<option>通用</option>
<option>移动设备</option>
<option>Web 浏览器</option>
<option>边缘设备</option>
<option>服务器</option>
</select>
</div>
</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<div class="flex items-center mb-3">
<label class="custom-checkbox">
<input type="checkbox" checked>
<span class="checkmark"></span>
</label>
<span class="text-sm text-gray-700">启用量化</span>
</div>
<div class="flex items-center mb-3">
<label class="custom-checkbox">
<input type="checkbox" checked>
<span class="checkmark"></span>
</label>
<span class="text-sm text-gray-700">优化推理性能</span>
</div>
<div class="flex items-center mb-3">
<label class="custom-checkbox">
<input type="checkbox" checked>
<span class="checkmark"></span>
</label>
<span class="text-sm text-gray-700">保留模型结构</span>
</div>
<div class="flex items-center">
<label class="custom-checkbox">
<input type="checkbox">
<span class="checkmark"></span>
</label>
<span class="text-sm text-gray-700">转换完成后自动验证</span>
</div>
</div>
</div>
<div class="mb-6">
<div class="flex justify-between items-center mb-2">
<label class="block text-sm font-medium text-gray-700">高级设置</label>
<button class="text-primary text-sm hover:text-blue-600">展开</button>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">批处理大小</label>
<select class="w-full px-3 py-2 border border-gray-300 rounded-button text-sm focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent pr-8 appearance-none bg-white">
<option>1</option>
<option>4</option>
<option>8</option>
<option>16</option>
<option>32</option>
<option>动态</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">量化精度</label>
<select class="w-full px-3 py-2 border border-gray-300 rounded-button text-sm focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent pr-8 appearance-none bg-white">
<option>FP32</option>
<option>FP16</option>
<option>INT8</option>
<option>混合精度</option>
</select>
</div>
</div>
</div>
<div class="flex justify-end space-x-3">
<button id="cancelNewConversion" class="px-4 py-2 bg-white border border-gray-300 rounded-button text-sm font-medium text-gray-700 hover:bg-gray-50 whitespace-nowrap !rounded-button">取消</button>
<button class="px-4 py-2 bg-primary text-white rounded-button text-sm font-medium hover:bg-blue-600 whitespace-nowrap !rounded-button">创建转换任务</button>
</div>
</div>
</div>
</div>
<!-- 任务详情模态框 -->
<div id="taskDetailModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-lg w-full max-w-4xl max-h-[90vh] overflow-y-auto">
<div class="flex justify-between items-center p-6 border-b border-gray-100">
<div class="flex items-center">
<div class="w-10 h-10 flex items-center justify-center rounded-lg bg-blue-50 text-primary mr-3">
<i class="ri-file-transfer-line ri-lg"></i>
</div>
<div>
<h3 class="text-lg font-medium text-gray-900">PyTorch 转 ONNX</h3>
<p class="text-sm text-gray-500">CONV-20250626-001</p>
</div>
</div>
<div class="flex items-center space-x-3">
<button class="px-3 py-1.5 text-xs font-medium text-primary bg-blue-50 rounded-button hover:bg-blue-100 whitespace-nowrap !rounded-button">
<div class="w-4 h-4 flex items-center justify-center mr-1 inline-block">
<i class="ri-download-line"></i>
</div>
下载模型
</button>
<button id="closeTaskDetailModal" class="text-gray-400 hover:text-gray-500">
<i class="ri-close-line ri-lg"></i>
</button>
</div>
</div>
<div class="flex border-b border-gray-100">
<button class="task-tab-button px-6 py-3 text-sm font-medium tab-active" data-tab="overview">概览</button>
<button class="task-tab-button px-6 py-3 text-sm font-medium text-gray-500 hover:text-gray-700" data-tab="config">配置详情</button>
<button class="task-tab-button px-6 py-3 text-sm font-medium text-gray-500 hover:text-gray-700" data-tab="performance">性能对比</button>
<button class="task-tab-button px-6 py-3 text-sm font-medium text-gray-500 hover:text-gray-700" data-tab="logs">转换日志</button>
</div>
<div class="p-6">
<!-- 概览 Tab -->
<div id="overview" class="task-tab-content active">
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<div class="md:col-span-2">
<div class="mb-6">
<h4 class="text-sm font-medium text-gray-700 mb-2">转换信息</h4>
<p class="text-sm text-gray-600">
本次转换任务将智能推荐模型 v2.3.5 从 PyTorch 格式转换为 ONNX 格式，启用了量化和性能优化，保留了原始模型结构。转换过程顺利完成，模型已准备好用于跨平台部署。
</p>
</div>
<div class="mb-6">
<h4 class="text-sm font-medium text-gray-700 mb-2">模型信息</h4>
<div class="grid grid-cols-2 gap-4">
<div class="bg-gray-50 p-3 rounded">
<p class="text-xs text-gray-500">源模型</p>
<p class="text-sm font-medium text-gray-700">智能推荐模型 v2.3.5</p>
</div>
<div class="bg-gray-50 p-3 rounded">
<p class="text-xs text-gray-500">源格式</p>
<p class="text-sm font-medium text-gray-700">PyTorch (.pt)</p>
</div>
<div class="bg-gray-50 p-3 rounded">
<p class="text-xs text-gray-500">目标格式</p>
<p class="text-sm font-medium text-gray-700">ONNX (.onnx)</p>
</div>
<div class="bg-gray-50 p-3 rounded">
<p class="text-xs text-gray-500">目标平台</p>
<p class="text-sm font-medium text-gray-700">通用</p>
</div>
</div>
</div>
<div>
<h4 class="text-sm font-medium text-gray-700 mb-2">转换结果</h4>
<div class="grid grid-cols-2 gap-4">
<div class="bg-gray-50 p-3 rounded">
<p class="text-xs text-gray-500">源模型大小</p>
<p class="text-sm font-medium text-gray-700">245 MB</p>
</div>
<div class="bg-gray-50 p-3 rounded">
<p class="text-xs text-gray-500">转换后大小</p>
<p class="text-sm font-medium text-gray-700">210 MB</p>
</div>
<div class="bg-gray-50 p-3 rounded">
<p class="text-xs text-gray-500">大小变化</p>
<p class="text-sm font-medium text-green-600">-14.3%</p>
</div>
<div class="bg-gray-50 p-3 rounded">
<p class="text-xs text-gray-500">精度保持</p>
<p class="text-sm font-medium text-gray-700">99.9%</p>
</div>
</div>
</div>
</div>
<div>
<div class="bg-white border border-gray-200 rounded-lg p-4 mb-6">
<h4 class="text-sm font-medium text-gray-700 mb-3">转换状态</h4>
<div class="flex justify-center mb-3">
<div class="w-24 h-24 flex items-center justify-center rounded-full bg-green-50 text-green-500">
<i class="ri-check-line ri-3x"></i>
</div>
</div>
<div class="text-center mb-3">
<p class="text-base font-medium text-gray-900">转换成功</p>
<p class="text-xs text-gray-500">2025-06-26 09:38</p>
</div>
<div class="space-y-2">
<div>
<div class="flex justify-between items-center mb-1">
<span class="text-xs text-gray-500">转换进度</span>
<span class="text-xs font-medium text-gray-700">100%</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-1.5">
<div class="bg-green-500 h-1.5 rounded-full" style="width: 100%"></div>
</div>
</div>
</div>
</div>
<div class="bg-white border border-gray-200 rounded-lg p-4 mb-6">
<h4 class="text-sm font-medium text-gray-700 mb-3">转换时间</h4>
<div class="flex items-center justify-between mb-3">
<span class="text-sm text-gray-600">开始时间</span>
<span class="text-sm font-medium text-gray-700">2025-06-26 09:30</span>
</div>
<div class="flex items-center justify-between mb-3">
<span class="text-sm text-gray-600">结束时间</span>
<span class="text-sm font-medium text-gray-700">2025-06-26 09:38</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-gray-600">总耗时</span>
<span class="text-sm font-medium text-gray-700">8分钟</span>
</div>
</div>
</div>
</div>
</div>
<!-- 配置详情 Tab -->
<div id="config" class="task-tab-content">
<div class="mb-6">
<div class="flex justify-between items-center mb-4">
<h4 class="text-lg font-medium text-gray-900">转换配置详情</h4>
<button class="text-primary text-sm hover:text-blue-600">导出配置</button>
</div>
<div class="bg-gray-50 p-6 rounded-lg">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<h5 class="text-sm font-medium text-gray-700 mb-4">基本配置</h5>
<div class="space-y-4">
<div>
<p class="text-xs text-gray-500 mb-1">任务名称</p>
<p class="text-sm font-medium text-gray-800">PyTorch 转 ONNX</p>
</div>
<div>
<p class="text-xs text-gray-500 mb-1">任务 ID</p>
<p class="text-sm font-medium text-gray-800">CONV-20250626-001</p>
</div>
<div>
<p class="text-xs text-gray-500 mb-1">创建人</p>
<p class="text-sm font-medium text-gray-800">陈思远</p>
</div>
<div>
<p class="text-xs text-gray-500 mb-1">创建时间</p>
<p class="text-sm font-medium text-gray-800">2025-06-26 09:30</p>
</div>
</div>
</div>
<div>
<h5 class="text-sm font-medium text-gray-700 mb-4">模型信息</h5>
<div class="space-y-4">
<div>
<p class="text-xs text-gray-500 mb-1">源模型</p>
<p class="text-sm font-medium text-gray-800">智能推荐模型 v2.3.5</p>
</div>
<div>
<p class="text-xs text-gray-500 mb-1">源格式</p>
<p class="text-sm font-medium text-gray-800">PyTorch (.pt)</p>
</div>
<div>
<p class="text-xs text-gray-500 mb-1">目标格式</p>
<p class="text-sm font-medium text-gray-800">ONNX (.onnx)</p>
</div>
<div>
<p class="text-xs text-gray-500 mb-1">目标平台</p>
<p class="text-sm font-medium text-gray-800">通用</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="mb-6">
<h4 class="text-lg font-medium text-gray-900 mb-4">优化设置</h4>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div class="bg-gray-50 p-6 rounded-lg">
<h5 class="text-sm font-medium text-gray-700 mb-4">转换选项</h5>
<div class="space-y-3">
<div class="flex items-center justify-between">
<span class="text-sm text-gray-600">启用量化</span>
<span class="px-2 py-1 text-xs font-medium text-green-700 bg-green-100 rounded-full">已启用</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-gray-600">优化推理性能</span>
<span class="px-2 py-1 text-xs font-medium text-green-700 bg-green-100 rounded-full">已启用</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-gray-600">保留模型结构</span>
<span class="px-2 py-1 text-xs font-medium text-green-700 bg-green-100 rounded-full">已启用</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-gray-600">转换完成后自动验证</span>
<span class="px-2 py-1 text-xs font-medium text-red-700 bg-red-100 rounded-full">未启用</span>
</div>
</div>
</div>
<div class="bg-gray-50 p-6 rounded-lg">
<h5 class="text-sm font-medium text-gray-700 mb-4">高级设置</h5>
<div class="space-y-3">
<div class="flex items-center justify-between">
<span class="text-sm text-gray-600">批处理大小</span>
<span class="text-sm font-medium text-gray-800">1</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-gray-600">量化精度</span>
<span class="text-sm font-medium text-gray-800">FP32</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-gray-600">输入形状</span>
<span class="text-sm font-medium text-gray-800">动态</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-gray-600">算子融合</span>
<span class="text-sm font-medium text-gray-800">启用</span>
</div>
</div>
</div>
</div>
</div>
<div>
<h4 class="text-lg font-medium text-gray-900 mb-4">ONNX 特定配置</h4>
<div class="bg-gray-50 p-6 rounded-lg">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<h5 class="text-sm font-medium text-gray-700 mb-4">ONNX 版本</h5>
<div class="space-y-3">
<div class="flex items-center justify-between">
<span class="text-sm text-gray-600">ONNX 版本</span>
<span class="text-sm font-medium text-gray-800">1.12.0</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-gray-600">Opset 版本</span>
<span class="text-sm font-medium text-gray-800">15</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-gray-600">IR 版本</span>
<span class="text-sm font-medium text-gray-800">8</span>
</div>
</div>
</div>
<div>
<h5 class="text-sm font-medium text-gray-700 mb-4">导出选项</h5>
<div class="space-y-3">
<div class="flex items-center justify-between">
<span class="text-sm text-gray-600">导出参数</span>
<span class="text-sm font-medium text-gray-800">True</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-gray-600">导出训练信息</span>
<span class="text-sm font-medium text-gray-800">False</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-gray-600">简化模型</span>
<span class="text-sm font-medium text-gray-800">True</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 性能对比 Tab -->
<div id="performance" class="task-tab-content">
<div class="mb-6">
<div class="flex justify-between items-center mb-4">
<h4 class="text-lg font-medium text-gray-900">性能对比分析</h4>
<div>
<select class="pl-3 pr-8 py-1.5 border border-gray-300 rounded-button text-xs focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent appearance-none bg-white">
<option>所有指标</option>
<option>推理性能</option>
<option>内存占用</option>
<option>精度对比</option>
</select>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div class="bg-white border border-gray-200 rounded-lg p-4">
<h5 class="text-sm font-medium text-gray-700 mb-4">推理时间对比 (ms)</h5>
<div id="inferenceTimeComparisonChart" class="h-64"></div>
</div>
<div class="bg-white border border-gray-200 rounded-lg p-4">
<h5 class="text-sm font-medium text-gray-700 mb-4">内存占用对比 (MB)</h5>
<div id="memoryUsageComparisonChart" class="h-64"></div>
</div>
</div>
</div>
<div class="mb-6">
<div class="bg-white border border-gray-200 rounded-lg p-4">
<h5 class="text-sm font-medium text-gray-700 mb-4">精度对比</h5>
<div id="accuracyDetailComparisonChart" class="h-64"></div>
</div>
</div>
<div class="mb-6">
<h4 class="text-lg font-medium text-gray-900 mb-4">详细性能指标</h4>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">指标</th>
<th scope="col" class="px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">PyTorch (原始)</th>
<th scope="col" class="px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">ONNX (转换后)</th>
<th scope="col" class="px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">变化</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">推理时间 (ms)</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">25.3</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">18.5</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-500 text-center">-26.9%</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">内存占用 (MB)</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">850</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">720</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-500 text-center">-15.3%</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">模型大小 (MB)</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">245</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">210</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-500 text-center">-14.3%</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">准确率 (%)</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">92.7</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">92.6</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-yellow-500 text-center">-0.1%</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">加载时间 (ms)</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">320</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">280</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-500 text-center">-12.5%</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">吞吐量 (样本/秒)</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">39.5</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center">54.1</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-500 text-center">+36.9%</td>
</tr>
</tbody>
</table>
</div>
</div>
<div>
<h4 class="text-lg font-medium text-gray-900 mb-4">性能测试环境</h4>
<div class="bg-gray-50 p-6 rounded-lg">
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<div>
<h5 class="text-sm font-medium text-gray-700 mb-4">硬件环境</h5>
<div class="space-y-3">
<div>
<p class="text-xs text-gray-500 mb-1">CPU</p>
<p class="text-sm font-medium text-gray-800">Intel Xeon E5-2680 v4</p>
</div>
<div>
<p class="text-xs text-gray-500 mb-1">内存</p>
<p class="text-sm font-medium text-gray-800">64GB DDR4</p>
</div>
<div>
<p class="text-xs text-gray-500 mb-1">GPU</p>
<p class="text-sm font-medium text-gray-800">NVIDIA Tesla T4</p>
</div>
</div>
</div>
<div>
<h5 class="text-sm font-medium text-gray-700 mb-4">软件环境</h5>
<div class="space-y-3">
<div>
<p class="text-xs text-gray-500 mb-1">操作系统</p>
<p class="text-sm font-medium text-gray-800">Ubuntu 22.04 LTS</p>
</div>
<div>
<p class="text-xs text-gray-500 mb-1">PyTorch 版本</p>
<p class="text-sm font-medium text-gray-800">2.0.1</p>
</div>
<div>
<p class="text-xs text-gray-500 mb-1">ONNX 版本</p>
<p class="text-sm font-medium text-gray-800">1.12.0</p>
</div>
</div>
</div>
<div>
<h5 class="text-sm font-medium text-gray-700 mb-4">测试配置</h5>
<div class="space-y-3">
<div>
<p class="text-xs text-gray-500 mb-1">批处理大小</p>
<p class="text-sm font-medium text-gray-800">1</p>
</div>
<div>
<p class="text-xs text-gray-500 mb-1">迭代次数</p>
<p class="text-sm font-medium text-gray-800">1000</p>
</div>
<div>
<p class="text-xs text-gray-500 mb-1">预热迭代</p>
<p class="text-sm font-medium text-gray-800">100</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 转换日志 Tab -->
<div id="logs" class="task-tab-content">
<div class="mb-6">
<div class="flex justify-between items-center mb-4">
<h4 class="text-lg font-medium text-gray-900">转换过程日志</h4>
<button id="exportLogBtn" class="text-primary text-sm hover:text-blue-600">导出日志</button>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<div class="flex items-center mb-4">
<div class="w-6 h-6 flex items-center justify-center rounded-full bg-blue-100 text-primary mr-2">
<i class="ri-information-line"></i>
</div>
<span class="text-sm font-medium text-gray-800">完整日志</span>
</div>
<div class="bg-gray-900 text-gray-100 p-4 rounded-lg font-mono text-xs overflow-auto h-96">
<p>[2025-06-26 09:30:15] INFO: 开始转换任务 CONV-20250626-001</p>
<p>[2025-06-26 09:30:15] INFO: 源模型: 智能推荐模型 v2.3.5 (PyTorch)</p>
<p>[2025-06-26 09:30:15] INFO: 目标格式: ONNX</p>
<p>[2025-06-26 09:30:16] INFO: 加载 PyTorch 模型...</p>
<p>[2025-06-26 09:30:18] INFO: 模型加载成功，大小: 245 MB</p>
<p>[2025-06-26 09:30:18] INFO: 检查模型结构...</p>
<p>[2025-06-26 09:30:19] INFO: 模型结构检查通过</p>
<p>[2025-06-26 09:30:19] INFO: 开始转换为 ONNX 格式...</p>
<p>[2025-06-26 09:30:25] INFO: 创建 ONNX 导出器，设置 opset_version=15</p>
<p>[2025-06-26 09:30:26] INFO: 设置动态轴...</p>
<p>[2025-06-26 09:30:27] INFO: 执行模型跟踪...</p>
<p>[2025-06-26 09:30:35] INFO: 模型跟踪完成</p>
<p>[2025-06-26 09:30:35] INFO: 导出模型到 ONNX...</p>
<p>[2025-06-26 09:32:42] INFO: 基础导出完成</p>
<p>[2025-06-26 09:32:42] INFO: 执行 ONNX 模型检查...</p>
<p>[2025-06-26 09:32:45] INFO: ONNX 模型检查通过</p>
<p>[2025-06-26 09:32:45] INFO: 开始优化 ONNX 模型...</p>
<p>[2025-06-26 09:32:46] INFO: 应用常量折叠优化...</p>
<p>[2025-06-26 09:33:15] INFO: 应用算子融合优化...</p>
<p>[2025-06-26 09:33:45] INFO: 应用冗余节点消除...</p>
<p>[2025-06-26 09:34:10] INFO: 优化完成</p>
<p>[2025-06-26 09:34:10] INFO: 开始量化模型...</p>
<p>[2025-06-26 09:34:11] INFO: 使用 FP32 精度进行量化</p>
<p>[2025-06-26 09:36:30] INFO: 量化完成</p>
<p>[2025-06-26 09:36:30] INFO: 保存最终 ONNX 模型...</p>
<p>[2025-06-26 09:37:05] INFO: 模型保存完成，大小: 210 MB</p>
<p>[2025-06-26 09:37:05] INFO: 开始性能测试...</p>
<p>[2025-06-26 09:37:10] INFO: 测试原始 PyTorch 模型性能...</p>
<p>[2025-06-26 09:37:25] INFO: PyTorch 模型推理时间: 25.3 ms</p>
<p>[2025-06-26 09:37:25] INFO: PyTorch 模型内存占用: 850 MB</p>
<p>[2025-06-26 09:37:25] INFO: 测试转换后 ONNX 模型性能...</p>
<p>[2025-06-26 09:37:40] INFO: ONNX 模型推理时间: 18.5 ms</p>
<p>[2025-06-26 09:37:40] INFO: ONNX 模型内存占用: 720 MB</p>
<p>[2025-06-26 09:37:40] INFO: 性能测试完成</p>
<p>[2025-06-26 09:37:41] INFO: 验证模型精度...</p>
<p>[2025-06-26 09:38:00] INFO: 精度验证完成，精度保持率: 99.9%</p>
<p>[2025-06-26 09:38:00] INFO: 转换任务成功完成</p>
<p>[2025-06-26 09:38:00] INFO: 总耗时: 8分钟</p>
</div>
</div>
</div>
<div class="mb-6">
<h4 class="text-lg font-medium text-gray-900 mb-4">日志摘要</h4>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<div class="bg-blue-50 p-4 rounded-lg">
<div class="flex items-center mb-3">
<div class="w-8 h-8 flex items-center justify-center rounded-full bg-blue-100 text-blue-500 mr-2">
<i class="ri-information-line"></i>
</div>
<span class="text-sm font-medium text-gray-800">信息</span>
</div>
<p class="text-sm text-gray-600">35 条信息日志</p>
</div>
<div class="bg-yellow-50 p-4 rounded-lg">
<div class="flex items-center mb-3">
<div class="w-8 h-8 flex items-center justify-center rounded-full bg-yellow-100 text-yellow-500 mr-2">
<i class="ri-error-warning-line"></i>
</div>
<span class="text-sm font-medium text-gray-800">警告</span>
</div>
<p class="text-sm text-gray-600">0 条警告日志</p>
</div>
<div class="bg-red-50 p-4 rounded-lg">
<div class="flex items-center mb-3">
<div class="w-8 h-8 flex items-center justify-center rounded-full bg-red-100 text-red-500 mr-2">
<i class="ri-error-warning-fill"></i>
</div>
<span class="text-sm font-medium text-gray-800">错误</span>
</div>
<p class="text-sm text-gray-600">0 条错误日志</p>
</div>
</div>
</div>
<div>
<h4 class="text-lg font-medium text-gray-900 mb-4">关键事件</h4>
<div class="relative">
<div class="absolute left-4 top-0 bottom-0 w-0.5 bg-gray-200"></div>
<div class="space-y-6 relative">
<div class="flex">
<div class="w-8 h-8 flex items-center justify-center rounded-full bg-blue-100 text-blue-500 z-10 mr-4">
<i class="ri-play-circle-line"></i>
</div>
<div class="bg-white border border-gray-200 rounded-lg p-4 flex-grow">
<div class="flex justify-between items-center mb-1">
<h5 class="text-sm font-medium text-gray-800">开始转换任务</h5>
<span class="text-xs text-gray-500">09:30:15</span>
</div>
<p class="text-sm text-gray-600">任务初始化，加载源模型</p>
</div>
</div>
<div class="flex">
<div class="w-8 h-8 flex items-center justify-center rounded-full bg-blue-100 text-blue-500 z-10 mr-4">
<i class="ri-file-transfer-line"></i>
</div>
<div class="bg-white border border-gray-200 rounded-lg p-4 flex-grow">
<div class="flex justify-between items-center mb-1">
<h5 class="text-sm font-medium text-gray-800">执行 ONNX 转换</h5>
<span class="text-xs text-gray-500">09:30:35</span>
</div>
<p class="text-sm text-gray-600">模型跟踪并导出为 ONNX 格式</p>
</div>
</div>
<div class="flex">
<div class="w-8 h-8 flex items-center justify-center rounded-full bg-blue-100 text-blue-500 z-10 mr-4">
<i class="ri-settings-3-line"></i>
</div>
<div class="bg-white border border-gray-200 rounded-lg p-4 flex-grow">
<div class="flex justify-between items-center mb-1">
<h5 class="text-sm font-medium text-gray-800">优化模型</h5>
<span class="text-xs text-gray-500">09:32:45</span>
</div>
<p class="text-sm text-gray-600">应用常量折叠、算子融合等优化</p>
</div>
</div>
<div class="flex">
<div class="w-8 h-8 flex items-center justify-center rounded-full bg-blue-100 text-blue-500 z-10 mr-4">
<i class="ri-scales-3-line"></i>
</div>
<div class="bg-white border border-gray-200 rounded-lg p-4 flex-grow">
<div class="flex justify-between items-center mb-1">
<h5 class="text-sm font-medium text-gray-800">量化模型</h5>
<span class="text-xs text-gray-500">09:34:10</span>
</div>
<p class="text-sm text-gray-600">使用 FP32 精度进行模型量化</p>
</div>
</div>
<div class="flex">
<div class="w-8 h-8 flex items-center justify-center rounded-full bg-blue-100 text-blue-500 z-10 mr-4">
<i class="ri-speed-line"></i>
</div>
<div class="bg-white border border-gray-200 rounded-lg p-4 flex-grow">
<div class="flex justify-between items-center mb-1">
<h5 class="text-sm font-medium text-gray-800">性能测试</h5>
<span class="text-xs text-gray-500">09:37:05</span>
</div>
<p class="text-sm text-gray-600">测试并比较原始与转换后模型性能</p>
</div>
</div>
<div class="flex">
<div class="w-8 h-8 flex items-center justify-center rounded-full bg-green-100 text-green-500 z-10 mr-4">
<i class="ri-check-line"></i>
</div>
<div class="bg-white border border-gray-200 rounded-lg p-4 flex-grow">
<div class="flex justify-between items-center mb-1">
<h5 class="text-sm font-medium text-gray-800">转换完成</h5>
<span class="text-xs text-gray-500">09:38:00</span>
</div>
<p class="text-sm text-gray-600">转换任务成功完成，总耗时 8 分钟</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script id="chartInitialization">
document.addEventListener('DOMContentLoaded', function() {
// 推理性能对比图
const inferencePerformanceChart = echarts.init(document.getElementById('inferencePerformanceChart'));
const inferencePerformanceOption = {
animation: false,
tooltip: {
trigger: 'axis',
backgroundColor: 'rgba(255, 255, 255, 0.8)',
borderColor: '#e2e8f0',
borderWidth: 1,
textStyle: {
color: '#1f2937'
},
axisPointer: {
type: 'shadow'
}
},
legend: {
data: ['原始格式', '转换后格式'],
textStyle: {
color: '#1f2937'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
data: ['PyTorch → ONNX', 'TensorFlow → TensorRT', 'ONNX → OpenVINO', 'Keras → TF Lite', 'PyTorch → TorchScript'],
axisLine: {
lineStyle: {
color: '#e2e8f0'
}
},
axisLabel: {
color: '#1f2937',
interval: 0,
rotate: 30
}
}
],
yAxis: [
{
type: 'value',
name: '推理时间 (ms)',
min: 0,
max: 30,
axisLine: {
show: false
},
axisTick: {
show: false
},
splitLine: {
lineStyle: {
color: '#e2e8f0',
type: 'dashed'
}
},
axisLabel: {
color: '#1f2937'
}
}
],
series: [
{
name: '原始格式',
type: 'bar',
barGap: 0,
data: [25.3, 28.5, 22.4, 18.7, 24.1],
itemStyle: {
color: 'rgba(87, 181, 231, 1)'
}
},
{
name: '转换后格式',
type: 'bar',
data: [18.5, 8.2, 12.4, 10.3, 22.1],
itemStyle: {
color: 'rgba(141, 211, 199, 1)'
}
}
]
};
inferencePerformanceChart.setOption(inferencePerformanceOption);
// 内存占用对比图
const memoryUsageChart = echarts.init(document.getElementById('memoryUsageChart'));
const memoryUsageOption = {
animation: false,
tooltip: {
trigger: 'axis',
backgroundColor: 'rgba(255, 255, 255, 0.8)',
borderColor: '#e2e8f0',
borderWidth: 1,
textStyle: {
color: '#1f2937'
},
axisPointer: {
type: 'shadow'
}
},
legend: {
data: ['原始格式', '转换后格式'],
textStyle: {
color: '#1f2937'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
data: ['PyTorch → ONNX', 'TensorFlow → TensorRT', 'ONNX → OpenVINO', 'Keras → TF Lite', 'PyTorch → TorchScript'],
axisLine: {
lineStyle: {
color: '#e2e8f0'
}
},
axisLabel: {
color: '#1f2937',
interval: 0,
rotate: 30
}
}
],
yAxis: [
{
type: 'value',
name: '内存占用 (MB)',
min: 0,
max: 1000,
axisLine: {
show: false
},
axisTick: {
show: false
},
splitLine: {
lineStyle: {
color: '#e2e8f0',
type: 'dashed'
}
},
axisLabel: {
color: '#1f2937'
}
}
],
series: [
{
name: '原始格式',
type: 'bar',
barGap: 0,
data: [850, 920, 780, 650, 830],
itemStyle: {
color: 'rgba(87, 181, 231, 1)'
}
},
{
name: '转换后格式',
type: 'bar',
data: [720, 780, 680, 450, 820],
itemStyle: {
color: 'rgba(141, 211, 199, 1)'
}
}
]
};
memoryUsageChart.setOption(memoryUsageOption);
// 精度对比图
const accuracyComparisonChart = echarts.init(document.getElementById('accuracyComparisonChart'));
const accuracyComparisonOption = {
animation: false,
tooltip: {
trigger: 'axis',
backgroundColor: 'rgba(255, 255, 255, 0.8)',
borderColor: '#e2e8f0',
borderWidth: 1,
textStyle: {
color: '#1f2937'
}
},
legend: {
data: ['转换前', '转换后'],
textStyle: {
color: '#1f2937'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['PyTorch → ONNX', 'TensorFlow → TensorRT', 'ONNX → OpenVINO', 'Keras → TF Lite', 'PyTorch → TorchScript'],
axisLine: {
lineStyle: {
color: '#e2e8f0'
}
},
axisLabel: {
color: '#1f2937',
interval: 0,
rotate: 30
}
},
yAxis: {
type: 'value',
name: '准确率 (%)',
min: 75,
max: 100,
axisLine: {
show: false
},
axisTick: {
show: false
},
splitLine: {
lineStyle: {
color: '#e2e8f0',
type: 'dashed'
}
},
axisLabel: {
color: '#1f2937'
}
},
series: [
{
name: '转换前',
type: 'line',
smooth: true,
lineStyle: {
width: 3,
color: 'rgba(87, 181, 231, 1)'
},
symbol: 'circle',
symbolSize: 8,
data: [92.7, 89.5, 78.3, 85.1, 91.2]
},
{
name: '转换后',
type: 'line',
smooth: true,
lineStyle: {
width: 3,
color: 'rgba(141, 211, 199, 1)'
},
symbol: 'circle',
symbolSize: 8,
data: [92.6, 89.3, 78.1, 84.9, 91.2]
}
]
};
accuracyComparisonChart.setOption(accuracyComparisonOption);
// 任务详情模态框中的图表
// 推理时间对比图
const inferenceTimeComparisonChart = echarts.init(document.getElementById('inferenceTimeComparisonChart'));
const inferenceTimeComparisonOption = {
animation: false,
tooltip: {
trigger: 'axis',
backgroundColor: 'rgba(255, 255, 255, 0.8)',
borderColor: '#e2e8f0',
borderWidth: 1,
textStyle: {
color: '#1f2937'
},
axisPointer: {
type: 'shadow'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
data: ['单样本', '批量 (4)', '批量 (8)', '批量 (16)'],
axisLine: {
lineStyle: {
color: '#e2e8f0'
}
},
axisLabel: {
color: '#1f2937'
}
}
],
yAxis: [
{
type: 'value',
min: 0,
max: 100,
axisLine: {
show: false
},
axisTick: {
show: false
},
splitLine: {
lineStyle: {
color: '#e2e8f0',
type: 'dashed'
}
},
axisLabel: {
color: '#1f2937'
}
}
],
series: [
{
name: 'PyTorch',
type: 'bar',
barGap: 0,
data: [25.3, 42.6, 65.8, 92.4],
itemStyle: {
color: 'rgba(87, 181, 231, 1)'
},
label: {
show: true,
position: 'top',
formatter: '{c} ms',
fontSize: 10
}
},
{
name: 'ONNX',
type: 'bar',
data: [18.5, 32.1, 48.7, 68.2],
itemStyle: {
color: 'rgba(141, 211, 199, 1)'
},
label: {
show: true,
position: 'top',
formatter: '{c} ms',
fontSize: 10
}
}
]
};
inferenceTimeComparisonChart.setOption(inferenceTimeComparisonOption);
// 内存占用对比图
const memoryUsageComparisonChart = echarts.init(document.getElementById('memoryUsageComparisonChart'));
const memoryUsageComparisonOption = {
animation: false,
tooltip: {
trigger: 'axis',
backgroundColor: 'rgba(255, 255, 255, 0.8)',
borderColor: '#e2e8f0',
borderWidth: 1,
textStyle: {
color: '#1f2937'
},
axisPointer: {
type: 'shadow'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
data: ['加载时', '推理时', '峰值'],
axisLine: {
lineStyle: {
color: '#e2e8f0'
}
},
axisLabel: {
color: '#1f2937'
}
}
],
yAxis: [
{
type: 'value',
min: 0,
max: 1000,
axisLine: {
show: false
},
axisTick: {
show: false
},
splitLine: {
lineStyle: {
color: '#e2e8f0',
type: 'dashed'
}
},
axisLabel: {
color: '#1f2937'
}
}
],
series: [
{
name: 'PyTorch',
type: 'bar',
barGap: 0,
data: [650, 850, 920],
itemStyle: {
color: 'rgba(87, 181, 231, 1)'
},
label: {
show: true,
position: 'top',
formatter: '{c} MB',
fontSize: 10
}
},
{
name: 'ONNX',
type: 'bar',
data: [580, 720, 780],
itemStyle: {
color: 'rgba(141, 211, 199, 1)'
},
label: {
show: true,
position: 'top',
formatter: '{c} MB',
fontSize: 10
}
}
]
};
memoryUsageComparisonChart.setOption(memoryUsageComparisonOption);
// 精度详细对比图
const accuracyDetailComparisonChart = echarts.init(document.getElementById('accuracyDetailComparisonChart'));
const accuracyDetailComparisonOption = {
animation: false,
tooltip: {
trigger: 'axis',
backgroundColor: 'rgba(255, 255, 255, 0.8)',
borderColor: '#e2e8f0',
borderWidth: 1,
textStyle: {
color: '#1f2937'
},
axisPointer: {
type: 'shadow'
}
},
legend: {
data: ['PyTorch', 'ONNX'],
textStyle: {
color: '#1f2937'
}
},
radar: {
indicator: [
{ name: '准确率', max: 100 },
{ name: '精确率', max: 100 },
{ name: '召回率', max: 100 },
{ name: 'F1值', max: 100 },
{ name: 'AUC-ROC', max: 100 }
],
radius: '65%',
axisName: {
color: '#1f2937'
},
splitLine: {
lineStyle: {
color: '#e2e8f0'
}
},
splitArea: {
show: true,
areaStyle: {
color: ['#fff', '#f9fafb']
}
},
axisLine: {
lineStyle: {
color: '#e2e8f0'
}
}
},
series: [
{
name: '精度对比',
type: 'radar',
data: [
{
value: [92.7, 91.8, 88.3, 90.4, 95.2],
name: 'PyTorch',
areaStyle: {
color: 'rgba(87, 181, 231, 0.1)'
},
lineStyle: {
color: 'rgba(87, 181, 231, 1)'
},
itemStyle: {
color: 'rgba(87, 181, 231, 1)'
}
},
{
value: [92.6, 91.7, 88.2, 90.3, 95.1],
name: 'ONNX',
areaStyle: {
color: 'rgba(141, 211, 199, 0.1)'
},
lineStyle: {
color: 'rgba(141, 211, 199, 1)'
},
itemStyle: {
color: 'rgba(141, 211, 199, 1)'
}
}
]
}
]
};
accuracyDetailComparisonChart.setOption(accuracyDetailComparisonOption);
// 窗口大小变化时，重新调整图表大小
window.addEventListener('resize', function() {
inferencePerformanceChart.resize();
memoryUsageChart.resize();
accuracyComparisonChart.resize();
if (document.getElementById('inferenceTimeComparisonChart').offsetParent !== null) {
inferenceTimeComparisonChart.resize();
}
if (document.getElementById('memoryUsageComparisonChart').offsetParent !== null) {
memoryUsageComparisonChart.resize();
}
if (document.getElementById('accuracyDetailComparisonChart').offsetParent !== null) {
accuracyDetailComparisonChart.resize();
}
});
});
</script>
<script id="taskListFilter">
document.addEventListener('DOMContentLoaded', function() {
const taskSearchInput = document.getElementById('taskSearchInput');
const taskStatusSelect = taskSearchInput.closest('.flex').querySelector('select');
const taskTableBody = document.querySelector('tbody');
const originalRows = Array.from(taskTableBody.querySelectorAll('tr'));
function filterTasks() {
const searchTerm = taskSearchInput.value.toLowerCase();
const selectedStatus = taskStatusSelect.value;
originalRows.forEach(row => {
const taskName = row.querySelector('.text-sm.font-medium.text-gray-900').textContent.toLowerCase();
const taskId = row.querySelector('.text-xs.text-gray-500').textContent.toLowerCase();
const taskStatus = row.querySelector('span').textContent;
const matchesSearch = taskName.includes(searchTerm) || taskId.includes(searchTerm);
const matchesStatus = selectedStatus === '所有状态' || taskStatus === selectedStatus;
row.style.display = matchesSearch && matchesStatus ? '' : 'none';
});
}
taskSearchInput.addEventListener('input', filterTasks);
taskStatusSelect.addEventListener('change', filterTasks);
});
</script>
<script id="modalHandlers">
document.addEventListener('DOMContentLoaded', function() {
// 导出配置模态框
const exportConfigBtn = document.querySelector('.text-primary.text-sm.hover\\:text-blue-600');
const exportConfigModal = document.getElementById('exportConfigModal');
const closeExportConfigModal = document.getElementById('closeExportConfigModal');
const cancelExportConfig = document.getElementById('cancelExportConfig');
const startExportConfig = document.getElementById('startExportConfig');
if (exportConfigBtn && exportConfigModal) {
exportConfigBtn.addEventListener('click', function() {
exportConfigModal.classList.remove('hidden');
});
}
if (closeExportConfigModal) {
closeExportConfigModal.addEventListener('click', function() {
exportConfigModal.classList.add('hidden');
});
}
if (cancelExportConfig) {
cancelExportConfig.addEventListener('click', function() {
exportConfigModal.classList.add('hidden');
});
}
if (startExportConfig) {
startExportConfig.addEventListener('click', function() {
const selectedFormat = document.querySelector('input[name="exportFormat"]:checked').value;
const selectedContent = Array.from(document.querySelectorAll('input[name="exportContent"]:checked')).map(input => input.value);
// Create a sample configuration object
const config = {
format: selectedFormat,
content: selectedContent,
timestamp: new Date().toISOString()
};
// Convert to selected format
let content = '';
switch(selectedFormat) {
case 'json':
content = JSON.stringify(config, null, 2);
break;
case 'yaml':
content = `format: ${config.format}\ncontent:\n${config.content.map(c => `  - ${c}`).join('\n')}\ntimestamp: ${config.timestamp}`;
break;
case 'xml':
content = `<?xml version="1.0" encoding="UTF-8"?>\n<config>\n  <format>${config.format}</format>\n  <content>\n    ${config.content.map(c => `<item>${c}</item>`).join('\n    ')}\n  </content>\n  <timestamp>${config.timestamp}</timestamp>\n</config>`;
break;
}
// Create and download file
const blob = new Blob([content], { type: 'text/plain' });
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = `model-conversion-config.${selectedFormat}`;
document.body.appendChild(a);
a.click();
window.URL.revokeObjectURL(url);
document.body.removeChild(a);
exportConfigModal.classList.add('hidden');
});
}
// 新建转换任务模态框
const newConversionBtn = document.getElementById('newConversionBtn');
const newConversionModal = document.getElementById('newConversionModal');
const closeNewConversionModal = document.getElementById('closeNewConversionModal');
const cancelNewConversion = document.getElementById('cancelNewConversion');
if (newConversionBtn && newConversionModal) {
newConversionBtn.addEventListener('click', function() {
newConversionModal.classList.remove('hidden');
});
}
if (closeNewConversionModal) {
closeNewConversionModal.addEventListener('click', function() {
newConversionModal.classList.add('hidden');
});
}
if (cancelNewConversion) {
cancelNewConversion.addEventListener('click', function() {
newConversionModal.classList.add('hidden');
});
}
// 任务详情模态框
const taskDetailButtons = document.querySelectorAll('button.text-primary.hover\\:text-blue-600.mr-3');
const taskDetailModal = document.getElementById('taskDetailModal');
const closeTaskDetailModal = document.getElementById('closeTaskDetailModal');
if (taskDetailButtons.length > 0 && taskDetailModal) {
taskDetailButtons.forEach(button => {
button.addEventListener('click', function() {
taskDetailModal.classList.remove('hidden');
});
});
}
if (closeTaskDetailModal) {
closeTaskDetailModal.addEventListener('click', function() {
taskDetailModal.classList.add('hidden');
});
}
// 模态框外部点击关闭
window.addEventListener('click', function(event) {
if (event.target === newConversionModal) {
newConversionModal.classList.add('hidden');
}
if (event.target === taskDetailModal) {
taskDetailModal.classList.add('hidden');
}
if (event.target === exportConfigModal) {
exportConfigModal.classList.add('hidden');
}
});
// 任务详情页 Tab 切换
const taskTabButtons = document.querySelectorAll('.task-tab-button');
const taskTabContents = document.querySelectorAll('.task-tab-content');
if (taskTabButtons.length > 0) {
taskTabButtons.forEach(button => {
button.addEventListener('click', function() {
const tabName = this.getAttribute('data-tab');
// 移除所有 tab 的激活状态
taskTabButtons.forEach(btn => {
btn.classList.remove('tab-active');
btn.classList.add('text-gray-500');
btn.classList.remove('text-primary');
});
// 激活当前 tab
this.classList.add('tab-active');
this.classList.remove('text-gray-500');
// 隐藏所有 tab 内容
taskTabContents.forEach(content => {
content.classList.remove('active');
});
// 显示当前 tab 内容
document.getElementById(tabName).classList.add('active');
// 重新调整图表大小
if (tabName === 'performance') {
if (document.getElementById('inferenceTimeComparisonChart')) {
echarts.getInstanceByDom(document.getElementById('inferenceTimeComparisonChart')).resize();
}
if (document.getElementById('memoryUsageComparisonChart')) {
echarts.getInstanceByDom(document.getElementById('memoryUsageComparisonChart')).resize();
}
if (document.getElementById('accuracyDetailComparisonChart')) {
echarts.getInstanceByDom(document.getElementById('accuracyDetailComparisonChart')).resize();
}
}
});
});
}
});
</script>
</div>
</div>
<!-- 导出配置模态框 -->
<div id="exportConfigModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-lg w-full max-w-md">
<div class="flex justify-between items-center p-6 border-b border-gray-100">
<h3 class="text-lg font-medium text-gray-900">导出配置文件</h3>
<button id="closeExportConfigModal" class="text-gray-400 hover:text-gray-500">
<i class="ri-close-line ri-lg"></i>
</button>
</div>
<div class="p-6">
<div class="mb-6">
<h4 class="text-sm font-medium text-gray-700 mb-4">选择导出格式</h4>
<div class="space-y-3">
<label class="flex items-center">
<div class="custom-radio">
<input type="radio" name="exportFormat" value="json" checked>
<span class="radiomark"></span>
</div>
<span class="text-sm text-gray-700">JSON</span>
</label>
<label class="flex items-center">
<div class="custom-radio">
<input type="radio" name="exportFormat" value="yaml">
<span class="radiomark"></span>
</div>
<span class="text-sm text-gray-700">YAML</span>
</label>
<label class="flex items-center">
<div class="custom-radio">
<input type="radio" name="exportFormat" value="xml">
<span class="radiomark"></span>
</div>
<span class="text-sm text-gray-700">XML</span>
</label>
</div>
</div>
<div class="mb-6">
<h4 class="text-sm font-medium text-gray-700 mb-4">选择导出内容</h4>
<div class="space-y-3">
<label class="flex items-center">
<div class="custom-checkbox">
<input type="checkbox" name="exportContent" value="basic" checked>
<span class="checkmark"></span>
</div>
<span class="text-sm text-gray-700">基本配置</span>
</label>
<label class="flex items-center">
<div class="custom-checkbox">
<input type="checkbox" name="exportContent" value="optimization" checked>
<span class="checkmark"></span>
</div>
<span class="text-sm text-gray-700">优化设置</span>
</label>
<label class="flex items-center">
<div class="custom-checkbox">
<input type="checkbox" name="exportContent" value="advanced" checked>
<span class="checkmark"></span>
</div>
<span class="text-sm text-gray-700">高级设置</span>
</label>
<label class="flex items-center">
<div class="custom-checkbox">
<input type="checkbox" name="exportContent" value="onnx">
<span class="checkmark"></span>
</div>
<span class="text-sm text-gray-700">ONNX 特定配置</span>
</label>
</div>
</div>
<div class="flex justify-end space-x-3">
<button id="cancelExportConfig" class="px-4 py-2 bg-white border border-gray-300 rounded-button text-sm font-medium text-gray-700 hover:bg-gray-50 whitespace-nowrap !rounded-button">取消</button>
<button id="startExportConfig" class="px-4 py-2 bg-primary text-white rounded-button text-sm font-medium hover:bg-blue-600 whitespace-nowrap !rounded-button">导出</button>
</div>
</div>
</div>
</div>
<!-- 导出日志模态框 -->
<div id="exportLogModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-lg w-full max-w-md">
<div class="flex justify-between items-center p-6 border-b border-gray-100">
<h3 class="text-lg font-medium text-gray-900">导出日志文件</h3>
<button id="closeExportLogModal" class="text-gray-400 hover:text-gray-500">
<i class="ri-close-line ri-lg"></i>
</button>
</div>
<div class="p-6">
<div class="mb-6">
<h4 class="text-sm font-medium text-gray-700 mb-4">选择导出格式</h4>
<div class="space-y-3">
<label class="flex items-center">
<div class="custom-radio">
<input type="radio" name="logFormat" value="txt" checked>
<span class="radiomark"></span>
</div>
<span class="text-sm text-gray-700">TXT</span>
</label>
<label class="flex items-center">
<div class="custom-radio">
<input type="radio" name="logFormat" value="csv">
<span class="radiomark"></span>
</div>
<span class="text-sm text-gray-700">CSV</span>
</label>
<label class="flex items-center">
<div class="custom-radio">
<input type="radio" name="logFormat" value="json">
<span class="radiomark"></span>
</div>
<span class="text-sm text-gray-700">JSON</span>
</label>
</div>
</div>
<div class="mb-6">
<h4 class="text-sm font-medium text-gray-700 mb-4">选择日志范围</h4>
<div class="space-y-3">
<label class="flex items-center">
<div class="custom-checkbox">
<input type="checkbox" name="logContent" value="all" checked>
<span class="checkmark"></span>
</div>
<span class="text-sm text-gray-700">完整日志</span>
</label>
<label class="flex items-center">
<div class="custom-checkbox">
<input type="checkbox" name="logContent" value="error">
<span class="checkmark"></span>
</div>
<span class="text-sm text-gray-700">错误日志</span>
</label>
<label class="flex items-center">
<div class="custom-checkbox">
<input type="checkbox" name="logContent" value="warning">
<span class="checkmark"></span>
</div>
<span class="text-sm text-gray-700">警告日志</span>
</label>
<label class="flex items-center">
<div class="custom-checkbox">
<input type="checkbox" name="logContent" value="info">
<span class="checkmark"></span>
</div>
<span class="text-sm text-gray-700">信息日志</span>
</label>
</div>
</div>
<div class="flex justify-end space-x-3">
<button id="cancelExportLog" class="px-4 py-2 bg-white border border-gray-300 rounded-button text-sm font-medium text-gray-700 hover:bg-gray-50 whitespace-nowrap !rounded-button">取消</button>
<button id="startExportLog" class="px-4 py-2 bg-primary text-white rounded-button text-sm font-medium hover:bg-blue-600 whitespace-nowrap !rounded-button">导出</button>
</div>
</div>
</div>
</div>
<!-- 下载模态框 -->
<div id="downloadModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-lg w-full max-w-md">
<div class="flex justify-between items-center p-6 border-b border-gray-100">
<h3 class="text-lg font-medium text-gray-900">下载模型文件</h3>
<button id="closeDownloadModal" class="text-gray-400 hover:text-gray-500">
<i class="ri-close-line ri-lg"></i>
</button>
</div>
<div class="p-6">
<div class="mb-6">
<h4 class="text-sm font-medium text-gray-700 mb-4">选择下载内容</h4>
<div class="space-y-3">
<label class="flex items-center">
<div class="custom-checkbox">
<input type="checkbox" checked>
<span class="checkmark"></span>
</div>
<span class="text-sm text-gray-700">模型文件 (210MB)</span>
</label>
<label class="flex items-center">
<div class="custom-checkbox">
<input type="checkbox" checked>
<span class="checkmark"></span>
</div>
<span class="text-sm text-gray-700">配置文件 (15KB)</span>
</label>
<label class="flex items-center">
<div class="custom-checkbox">
<input type="checkbox">
<span class="checkmark"></span>
</div>
<span class="text-sm text-gray-700">性能测试报告 (85KB)</span>
</label>
</div>
</div>
<div id="downloadProgress" class="hidden">
<div class="mb-2 flex justify-between items-center">
<span class="text-sm font-medium text-gray-700">下载进度</span>
<span class="text-sm text-gray-500" id="downloadPercentage">0%</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-2 mb-4">
<div class="bg-primary h-2 rounded-full transition-all duration-300" id="downloadProgressBar" style="width: 0%"></div>
</div>
<p class="text-sm text-gray-500" id="downloadStatus">准备下载...</p>
</div>
<div class="flex justify-end space-x-3">
<button id="cancelDownload" class="px-4 py-2 bg-white border border-gray-300 rounded-button text-sm font-medium text-gray-700 hover:bg-gray-50 whitespace-nowrap !rounded-button">取消</button>
<button id="startDownload" class="px-4 py-2 bg-primary text-white rounded-button text-sm font-medium hover:bg-blue-600 whitespace-nowrap !rounded-button">开始下载</button>
</div>
</div>
</div>
</div>
<script id="downloadHandler">
document.addEventListener('DOMContentLoaded', function() {
const downloadModal = document.getElementById('downloadModal');
const closeDownloadModal = document.getElementById('closeDownloadModal');
const cancelDownload = document.getElementById('cancelDownload');
const startDownload = document.getElementById('startDownload');
const downloadProgress = document.getElementById('downloadProgress');
const downloadProgressBar = document.getElementById('downloadProgressBar');
const downloadPercentage = document.getElementById('downloadPercentage');
const downloadStatus = document.getElementById('downloadStatus');
const downloadButtons = document.querySelectorAll('.download-btn');
function showDownloadModal() {
downloadModal.classList.remove('hidden');
downloadProgress.classList.add('hidden');
startDownload.classList.remove('hidden');
downloadProgressBar.style.width = '0%';
downloadPercentage.textContent = '0%';
downloadStatus.textContent = '准备下载...';
}
function hideDownloadModal() {
downloadModal.classList.add('hidden');
}
function simulateDownload() {
downloadProgress.classList.remove('hidden');
startDownload.classList.add('hidden');
let progress = 0;
const interval = setInterval(() => {
progress += Math.random() * 15;
if (progress >= 100) {
progress = 100;
clearInterval(interval);
downloadStatus.textContent = '下载完成';
setTimeout(() => {
hideDownloadModal();
}, 1000);
} else {
downloadStatus.textContent = '正在下载...';
}
downloadProgressBar.style.width = `${progress}%`;
downloadPercentage.textContent = `${Math.round(progress)}%`;
}, 500);
}
downloadButtons.forEach(button => {
button.addEventListener('click', showDownloadModal);
});
closeDownloadModal.addEventListener('click', hideDownloadModal);
cancelDownload.addEventListener('click', hideDownloadModal);
startDownload.addEventListener('click', simulateDownload);
// 点击模态框外部关闭
downloadModal.addEventListener('click', function(event) {
if (event.target === downloadModal) {
hideDownloadModal();
}
});
});
</script>
</body>
</html>